import * as echarts from 'echarts';
const myEcharts = echarts.init(document.querySelector('.pie .chart'));

const option = {
  tooltip: {
    trigger: 'item'
  },
  legend: {
    bottom: '5%',
    left: 'center',
    itemWidth: 10,
    itemHeight: 10,
    textStyle: {
      color: 'rgba(255,255,255,.5)',
      fontSize: '11'
    },
  },
  
  series: [
    {
      name: '累计新冠确诊',
      type: 'pie',
      center: ['50%', '38%'],
      radius: ['40%', '60%'],
      label: {
        show: false
      },
      labelLine: {
        show: false
      },
      data: [
        { value: 504, name: '温州' },
        { value: 181, name: '杭州' },
        { value: 157, name: '宁波' },
        { value: 147, name: '台州' },
        { value: 55, name: '金华' },
        { value: 46, name: '嘉兴' },
        { value: 42, name: '绍兴' },
        { value: 17, name: '丽水' },
        { value: 14, name: '衢州' },
        { value: 10, name: '湖州' },
        { value: 10, name: '舟山' }
      ]
    }
  ]
};

myEcharts.setOption(option);

window.addEventListener('resize', function () {
  myEcharts.resize();
});
